#include <vector>
#include <algorithm>
#include <iostream>

using namespace std;

//值传递
void print_value(vector<int> vt){
    for(vector<int>::iterator iter = vt.begin(); iter != vt.end(); ++iter){
        cout<< *iter << " ";
    }

    cout << endl;
}

//常值传递
void print_const(const vector<int> vt){
    for(int i = 0; i < vt.size(); ++i){
        cout<< vt[i] << " ";
    }

    cout << endl;
}

//引用传递
void print_ref(vector<int> &vt){
    for(vector<int>::iterator iter = vt.begin(); iter != vt.end(); ++iter){
        cout<< *iter << " ";
    }

    cout << endl;
}

//常值引用传递
void print_const_ref(const vector<int> &vt){
    for(vector<int>::const_iterator iter = vt.begin(); iter != vt.end(); ++iter){
        cout<< *iter << " ";
    }

    cout << endl;
}

//常值引用传递_反向迭代器
void print_const_ref_reverse(const vector<int> &vt){
    for(vector<int>::const_reverse_iterator iter = vt.rbegin(); iter != vt.rend(); ++iter){
        cout<< *iter << " ";
    }

    cout << endl;
}

int main(int argc, char const *argv[])
{
    vector<int> vt{1,2,3,4,5,6};
    vector<int> vt1{7,8,9,0};

    vt1.insert(vt1.begin(), vt.begin()+2, vt.begin()+4);

    vt1.erase(vt1.begin(), vt1.begin()+2);

    print_value(vt1);

    print_ref(vt1);

    return 0;
}